home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2008 September
/
PCWorld_2008-09_cd.bin
/
v cisle
/
sadanastroju
/
wot-20080519-fx.xpi
/
chrome
/
wot.jar
/
content
/
firstrun.js
< prev
next >
Wrap
Text File
|
2008-03-20
|
2KB
|
81 lines
/*
firstrun.js
Copyright ⌐ 2007 Against Intuition, Inc. <info@mywot.com>
*/
const WOT_REGISTER_EULA_ASKED = "wot_register_eula_asked";
var wot_firstrun = {
init: function() {
try {
window.addEventListener("load", function(e) {
wot_firstrun.load();
}, false);
} catch (e) {
dump("wot_firstrun.init: failed with " + e + "\n");
}
},
show_eula: function()
{
try {
if (wot_prefs.eula_accepted ||
wot_hashtable.get(WOT_REGISTER_EULA_ASKED)) {
return;
}
wot_hashtable.set(WOT_REGISTER_EULA_ASKED, 1);
window.setTimeout(function() {
window.openDialog("chrome://wot/content/eula.xul",
"EULA", "chrome,titlebar,centerscreen,modal", null);
if (!wot_prefs.eula_accepted) {
wot_status.set("error",
wot_util.getstring("description_uninstall"));
}
wot_core.update();
}, 500);
} catch (e) {
dump("wot_firstrun.show_eula: failed with " + e + "\n");
}
},
open_guide: function()
{
try {
if (Number(wot_prefs.firstrun_guide) >= WOT_FIRSTRUN_GUIDE) {
return;
}
if (!wot_prefs.setChar("firstrun_guide",
WOT_FIRSTRUN_GUIDE.toString())) {
return;
}
window.setTimeout(function() {
var browser = getBrowser();
if (browser) {
browser.selectedTab = browser.addTab(WOT_FIRSTRUN_URL);
}
}, 500);
} catch (e) {
dump("wot_firstrun.open_guide: failed with " + e + "\n");
}
},
load: function() {
try {
this.show_eula();
this.open_guide();
} catch (e) {
dump("wot_firstrun.load: failed with " + e + "\n");
}
}
};
wot_firstrun.init();